package com.example.practice.title;

import android.app.Activity;
import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import androidx.annotation.Nullable;

import com.example.practice.R;

public class titleFunction extends LinearLayout {


    public titleFunction(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
        View view = LayoutInflater.from(context).inflate(R.layout.titlesetport,this);
        ImageView imageView = view.findViewById(R.id.IV_back);
        TextView textView = view.findViewById(R.id.TV_title);
        imageView.setBackgroundResource(R.drawable.back1);
        textView.setText("IP端口设置");
        imageView.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                ((Activity)context).finish();
            }
        });
    }
}
